package collection;

import java.util.ArrayList;
import java.util.Collection;

public class Test {

    public static void main(String[] args) {
        Collection<Point> c =new ArrayList<>();
        Point p = new Point(1,2);
        doSome(c,p);
        System.out.println("c:" + c);
        System.out.println("p:" + p);
    }

    public static void doSome(Collection<Point> c, Point p){
        c.add(p);
        p.setX(2);
        p = new Point(3,4);
        c = new ArrayList<>();
        c.add(p);

    }


}
